package com.yykj.im.center.server.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Builder
@Table
/**
 * 系统推送消息列表
 */
public class Notice {

    @Id
    @Column(length = 32)
    @TableId(type = IdType.INPUT)
    public String id;

    @Column(columnDefinition = "varchar(64) DEFAULT '' COMMENT '消息标题'", nullable = true)
    public String title;

    @Column(columnDefinition = "varchar(1000) DEFAULT '' COMMENT '消息内容'", nullable = true)
    public String content;

    @Column(columnDefinition = "varchar(500) DEFAULT '' COMMENT '链接地址,点击可跳转H5页面'", nullable = true)
    public String url;

    @Column(columnDefinition = "varchar(200) DEFAULT '' COMMENT '备注'", nullable = true)
    public String remark;

    @Column(columnDefinition = "datetime DEFAULT NULL COMMENT '定时发送日期,yyyy-MM-dd HH:mm:ss,为空表示 立即发送'")
    private LocalDateTime sendTime;

    @Column(columnDefinition = "datetime DEFAULT NULL COMMENT '添加时间'")
    private LocalDateTime createTime;

    @Column(columnDefinition = "datetime DEFAULT NULL COMMENT '真发送成功时间'")
    private LocalDateTime doSendTime;

    @Column(columnDefinition = "int(1) DEFAULT 0 COMMENT '患者性别,0:不限,1:男,2:女'", nullable = true)
    private int gender;

    @Column(columnDefinition = "int(10) DEFAULT 0 COMMENT '医院ID'", nullable = true)
    private int hospitalId;

    @Column(columnDefinition = "int(10) DEFAULT 0 COMMENT '部门ID'", nullable = true)
    private int departmentId;

    @Column(columnDefinition = "int(10) DEFAULT 0 COMMENT '发送状态,0:未发送,1:已发送,2:发送失败'", nullable = true)
    public int status;

    @Column(columnDefinition = "varchar(200) DEFAULT null COMMENT '如果发送成功 微信返回的msgKey'", nullable = true)
    public String msgKey;

    @Column(columnDefinition = "int(10) DEFAULT 0 COMMENT '是否删除,0:正常,1:已经删除'", nullable = true)
    public int dele;

    @Column(columnDefinition = "text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '所选用户,tencent_account_id,name@@@..字符串,以后做已读未读再分表'", nullable = true)
    public String users;

}
